#include<iostream>
#include<unordered_map>
using namespace std;


class Solution {
public:
    int singleNumber(vector<int>& nums) {
        unordered_map<int, int>hash;

        for (const int& num : nums) {
            hash[num]++;
        }

        for (const auto& pair : hash)
        {
            if (pair.second == 1)
                return pair.first;
        }
        return -1;
    }
};